#include<bits/stdc++.h>
#define int long long
using namespace std;
int c,T;
int n,m;
const int mod=998244353;
void sol(){
	scanf("%lld %lld",&n,&m);
	for(int i=1,x,y;i<=m;i++) scanf("%lld %lld",&x,&y);
	printf("%lld ",-(n-1)*2);
	printf("%lld\n",m);
}
signed main(){
	freopen("oi.in","r",stdin);
	freopen("oi.out","w",stdout);
	scanf("%lld %lld",&c,&T);
	while(T--) sol();
	return 0;
}
